import { ApiProperty } from '@nestjs/swagger';
import { DeviceStatus } from '../../common/enums';
import { DeviceMetaDto } from '../dto/device-meta.dto';

/**
 * Admin-facing device model with detailed device information
 * Version 1 of the model includes standard device fields and metadata
 */
export class DeviceAdminModel {
  @ApiProperty({
    description: 'Device ID',
    example: '123e4567-e89b-12d3-a456-426614174000',
  })
  id: string;

  @ApiProperty({
    description: 'Device serial number',
    example: 'SN12345678',
  })
  serialNumber: string;

  @ApiProperty({
    description: 'Device status',
    enum: DeviceStatus,
    example: DeviceStatus.ACTIVE,
  })
  status: DeviceStatus;

  @ApiProperty({
    description: 'ID of the user who registered the device',
    example: '123e4567-e89b-12d3-a456-426614174000',
  })
  registeredBy: string;

  @ApiProperty({
    description: 'Registration date',
    example: '2025-01-01T12:00:00Z',
  })
  registeredAt: Date;

  @ApiProperty({
    description: 'Last used date',
    example: '2025-01-15T14:30:00Z',
    nullable: true,
  })
  lastUsedAt: Date | null;

  @ApiProperty({
    description: 'ID of the user bound to the device',
    example: '123e4567-e89b-12d3-a456-426614174000',
    nullable: true,
  })
  userId: string | null;

  @ApiProperty({
    description: 'Device metadata',
    type: DeviceMetaDto,
  })
  metadata: DeviceMetaDto;
}
